package com.cloud.consumer.controller;

import com.cloud.consumer.service.IProducerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author wangy
 * @create 2021/6/15 9:56
 * @Description   openFeign形式调用 producer接口
 */
@RestController
@RequestMapping("/openFeignConsumer")
public class OpenFeignConsumerController {

    @Autowired
    private IProducerService producerService;

    /**
     * openFeign形式调用 producer接口
     * @param name
     * @return
     */
    @PostMapping("/postDetail")
    public String postDetail(@RequestParam String name){
        return producerService.postDetail(name);
    }

    /**
     * openFeign形式调用 producer接口
     * @param name
     * @return
     */
    @GetMapping("/getDetail")
    public String getDetail(@RequestParam String name){
        return producerService.getDetail(name);
    }

}
